});
this.add_child(this._label);
- this._entry = new St.Entry({
+
+ let entryParams = {
style_class: 'login-dialog-prompt-entry',
can_focus: true,
x_expand: false,
y_expand: true,
- });
- ShellEntry.addContextMenu(this._entry, { isPassword: true, actionMode: Shell.ActionMode.NONE });
+ };
+
+ this._entry = null;
+ this._textEntry = new St.Entry(entryParams);
+ ShellEntry.addContextMenu(this._textEntry, { actionMode: Shell.ActionMode.NONE });
+
+ this._passwordEntry = new St.PasswordEntry(entryParams);
+ ShellEntry.addContextMenu(this._passwordEntry, { actionMode: Shell.ActionMode.NONE });
+
+ this._entry = this._passwordEntry;
this.add_child(this._entry);
this._entry.grab_key_focus();
});
}
- _onAskQuestion(verifier, serviceName, question, passwordChar) {
+ _updateEntry(secret) {
+ if (secret && (this._entry != this._passwordEntry)) {
+ this.replace_child(this._entry, this._passwordEntry);
+ this._entry = this._passwordEntry;
+ } else if (!secret && (this._entry != this._textEntry)) {
+ this.replace_child(this._entry, this._textEntry);
+ this._entry = this._textEntry;
+ }
+ }
+
+ _onAskQuestion(verifier, serviceName, question, secret) {
if (this._queryingService)
this.clear();
this._preemptiveAnswer = null;
return;
}
- this.setPasswordChar(passwordChar);
+
+ this._updateEntry(secret);
this.setQuestion(question);
- if (passwordChar) {
+ if (secret) {
if (this._userVerifier.reauthenticating)
this.nextButton.label = _("Unlock");
else
this.stopSpinning();
}
- setPasswordChar(passwordChar) {
- this._entry.clutter_text.set_password_char(passwordChar);
- this._entry.menu.isPassword = passwordChar != '';
- }
-
setQuestion(question) {
this._label.set_text(question);
}
_askForUsernameAndBeginVerification() {
- this._authPrompt.setPasswordChar('');
this._authPrompt.setQuestion(_("Username: "));
this._showRealmLoginHint(this._realmManager.loginFormat);
if (!this.serviceIsForeground(serviceName))
return;
- this.emit('ask-question', serviceName, question, '');
+ this.emit('ask-question', serviceName, question, false);
}
_onSecretInfoQuery(client, serviceName, secretQuestion) {
return;
}
- this.emit('ask-question', serviceName, secretQuestion, '\u25cf');
+ this.emit('ask-question', serviceName, secretQuestion, true);
}
_onReset() {
y_align: Clutter.ActorAlign.CENTER });
label.set_text(_("Password:"));
label.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
- this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
- text: '',
- can_focus: true,
- x_expand: true });
- this._passwordEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
- ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
+ this._passwordEntry = new St.PasswordEntry({
+ style_class: 'prompt-dialog-password-entry',
+ text: '',
+ can_focus: true,
+ x_expand: true,
+ });
+ ShellEntry.addContextMenu(this._passwordEntry);
this._passwordEntry.clutter_text.connect('activate', this._onPasswordActivate.bind(this));
this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
x_align: Clutter.ActorAlign.START,
y_align: Clutter.ActorAlign.CENTER });
label.set_text(_("Type again:"));
- this._confirmEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
- text: '',
- can_focus: true,
- x_expand: true });
- this._confirmEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
- ShellEntry.addContextMenu(this._confirmEntry, { isPassword: true });
+ this._confirmEntry = new St.PasswordEntry({
+ style_class: 'prompt-dialog-password-entry',
+ text: '',
+ can_focus: true,
+ x_expand: true,
+ });
+ ShellEntry.addContextMenu(this._confirmEntry);
this._confirmEntry.clutter_text.connect('activate', this._onConfirmActivate.bind(this));
if (rtl) {
layout.attach(this._confirmEntry, 0, row, 1, 1);
let reactive = secret.key != null;
- secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
- text: secret.value, can_focus: reactive,
- reactive,
- x_expand: true });
- ShellEntry.addContextMenu(secret.entry,
- { isPassword: secret.password });
+ let entryParams = {
+ style_class: 'prompt-dialog-password-entry',
+ text: secret.value,
+ can_focus: reactive,
+ reactive,
+ x_expand: true,
+ };
+ if (secret.password)
+ secret.entry = new St.PasswordEntry(entryParams);
+ else
+ secret.entry = new St.Entry(entryParams);
+ ShellEntry.addContextMenu(secret.entry);
if (secret.validate)
secret.valid = secret.validate(secret);
layout.attach(secret.entry, 1, pos, 1, 1);
}
pos++;
-
- if (secret.password)
- secret.entry.clutter_text.set_password_char('\u25cf');
}
contentBox.messageBox.add(secretTable);
y_align: Clutter.ActorAlign.CENTER,
});
this._passwordBox.add_child(this._passwordLabel);
- this._passwordEntry = new St.Entry({
+ this._passwordEntry = new St.PasswordEntry({
style_class: 'prompt-dialog-password-entry',
text: "",
can_focus: true,
x_expand: true,
});
- ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
+ ShellEntry.addContextMenu(this._passwordEntry);
this._passwordEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
this._passwordEntry.bind_property('reactive',
this._passwordEntry.clutter_text, 'editable',
else
this._passwordLabel.set_text(request);
- if (echoOn)
- this._passwordEntry.clutter_text.set_password_char('');
- else
- this._passwordEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
+ this._passwordEntry.password_visible = echoOn;
this._passwordBox.show();
this._passwordEntry.set_text('');
this._pimLabel = new St.Label({ style_class: 'prompt-dialog-password-label',
text: _("PIM Number"),
y_align: Clutter.ActorAlign.CENTER });
- this._pimEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
- can_focus: true,
- x_expand: true });
+ this._pimEntry = new St.PasswordEntry({
+ style_class: 'prompt-dialog-password-entry',
+ can_focus: true,
+ x_expand: true,
+ });
this._pimEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
- this._pimEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
- ShellEntry.addContextMenu(this._pimEntry, { isPassword: true });
+ ShellEntry.addContextMenu(this._pimEntry);
if (rtl) {
layout.attach(this._pimEntry, 0, 0, 1, 1);
this._passwordLabel = new St.Label({ style_class: 'prompt-dialog-password-label',
text: _("Password"),
y_align: Clutter.ActorAlign.CENTER });
- this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
- can_focus: true,
- x_expand: true });
+ this._passwordEntry = new St.PasswordEntry({
+ style_class: 'prompt-dialog-password-entry',
+ can_focus: true,
+ x_expand: true,
+ });
this._passwordEntry.clutter_text.connect('activate', this._onEntryActivate.bind(this));
- this._passwordEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
- ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
+ ShellEntry.addContextMenu(this._passwordEntry);
this.setInitialKeyFocus(this._passwordEntry);
this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
animate: true,
this._authPrompt.connect('failed', this._fail.bind(this));
this._authPrompt.connect('cancelled', this._fail.bind(this));
this._authPrompt.connect('reset', this._onReset.bind(this));
- this._authPrompt.setPasswordChar('\u25cf');
this._authPrompt.nextButton.label = _("Unlock");
this._promptBox.add_child(this._authPrompt);